Skip to content

Addons: make it work on invalid URLs #12372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 19, 2025
Merged

Conversation

humitos
Copy link
Member

@humitos humitos commented Jul 30, 2025

Closes #12371

@humitos humitos requested a review from a team as a code owner July 30, 2025 10:59
@humitos humitos requested a review from stsewd July 30, 2025 10:59
# We do allow hitting this URL without a valid version.
# This is the same case than sending `?url=` with a partial match
# (eg. invalid URL path).
version = project.versions.filter(slug=version_slug).first()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably check if the version slug is empty instead. Given a wrong version and not version at all isn't the same.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing anything different if the version slug is invalid/empty when the ?url= attribute is passed either. This matches that behavior when using ?version= attribute.

I'm happy to discuss behaving differently in those cases if we want that, but I want to move forward with this PR here and work on that different behavior in a different one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #12420

Copy link

Documentation build overview

📚 dev | 🛠️ Build #29249131 | 📁 Comparing b1bb556 against latest (4286c03)


🔍 Preview build

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
settings.html 📝 modified

Copy link

Documentation build overview

📚 docs | 🛠️ Build #29249132 | 📁 Comparing b1bb556 against latest (4286c03)


🔍 Preview build

Show files changed (2 files in total): 📝 2 modified | ➕ 0 added | ➖ 0 deleted
File Status
config-file/index.html 📝 modified
config-file/v2.html 📝 modified

@humitos humitos merged commit 0153059 into main Aug 19, 2025
4 of 5 checks passed
@humitos humitos deleted the humitos/addons-on-invalid-urls branch August 19, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addons: not loaded on "invalid" URLs
2 participants